package com.own.business.level.entity.bo;

import com.own.business.level.entity.po.LevelConfig;
import com.own.component.common.base.entity.BaseBo;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * LevelConfigBo
 *
 * @author chenxueli
 * @date 2022-07-25 10:13:00
 */
@ApiModel("等级配置" + ConstantBeanSuffix.BO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class LevelConfigBo extends BaseBo<LevelConfig> {

    @ApiModelProperty("经验限制（需要大于上一级的上限）")
    private Integer exp;

    /**
     * 转持久化对象
     *
     * @param entity 原持久化对象
     * @return 持久化对象
     */
    @Override
    public LevelConfig toPo(LevelConfig entity) {
        if (entity == null) {
            entity = new LevelConfig();
        }
        entity.setExp(this.exp);
        return super.toPo(entity);
    }

}
